import upload from "@/utils/upload";
import request from "@/utils/request";

 //获取商家个人邀请码列表
 export function getCode(query) {
    return request({
      url: '/pw/codes/codeList',
	  headers: {
	  		  isToken: true
	  },
      method: 'get',
      params: query
    })
  }
  
  //查询所有邀请码列表
  export function cxcode(query) {
	  return request({
		  url:"/pw/codes/codeList",
		  headers:{
			  isToken:true
		  },
		  method: 'get',
		  params: query
	  })
  }
  //客服列表专用
  export function getCodeList(query) {
	  return request({
		  url:"/pw/codes/isManager",
		  headers:{
			  isToken:true
		  },
		  method: 'get',
		  params: query
	  })
  }

//解除客服/打手绑定邀请码
export function removecode(data) {
	return request({
		url: "/pw/codes/unbind",
		headers: {
			isToken: true
		},
		method: "post",
		data: data
	});
}
//生成邀请码二维码
export function createcode(params) {
	return request({
	  url: '/pw/codes/create_wxacode',
	  method: 'get',
	  params
	})
  }
  //设置总管
  export function createManager(params) {
	return request({
		url: "/pw/user/manager",
		headers: {
			isToken: true
		},
		method: "get",
		params
	});
}
//商家端可以显示每个客服发了多少单，消费了多少金额
export function getcustor(params) {
	return request({
		url: "/pw/work_orders/app/countList",
		headers: {
			isToken: true
		},
		method: "get",
		params
	});
}
//生成激活码，拉新返现使用
export function createActiveCode(params) {
	return request({
		url: "/pw/codes/activation_code",
		headers: {
			isToken: true
		},
		method: "get",
		params
	});
}